package com.ht.module.ai.controller;


import com.ht.module.ai.service.AiService;
import com.ht.module.ai.vo.AiChatVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import javax.annotation.Resource;
import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/ai")
@Api(tags = "ai对话控制层 ")
public class AiController {
    @Resource
    private AiService aiService;

    @ApiOperation("流式记忆对话")
    @PostMapping(value = "/streamMemory", produces = "text/stream;charset=UTF-8")
    public Flux<String> streamMemoryChat(@RequestBody @Valid AiChatVo vo) {
        return aiService.streamMemoryChat(vo);
    }

}